export default ({ service, request, serviceForMock, requestForMock, mock, faker, tools }) => ({

  sysRole: {
    sysRoleList (data = {}, param = {}) {
      return request({
        url: '/auth/system/role/page/search?sorts=seq&direction=desc&page=' + (param.page - 1) + '&size=' + param.size,
        method: 'post',
        data: data
      })
    },
    sysRoleFindById (data) {
      return request({
        url: '/auth/system/role/findById?id=' + data.id,
        method: 'get',
        data: data
      })
    },
    sysRoleUpdateById (data) {
      return request({
        url: '/auth/system/role/update',
        method: 'post',
        data: data
      })
    },
    sysRoleInsert (data) {
      return request({
        url: '/auth/system/role/insert',
        method: 'post',
        data: data
      })
    },
    sysRoleDeleteById (data) {
      return request({
        url: '/auth/system/role/delete',
        method: 'post',
        data: data
      })
    },
    sysfindUserByRoleId (data = {}, param = {}) {
      return request({
        url: '/auth/system/relational/roleAndUser/page/findUserByRoleId?roleId=' + param.id + '&page=' + (param.page - 1) + '&size=' + param.size,
        method: 'get',
        data: data
      })
    },
    addUser (data) {
      return request({
        url: '/auth/system/relational/roleAndUser/addUser',
        method: 'post',
        data: data
      })
    },
    deleteUser (data) {
      return request({
        url: '/auth/system/relational/roleAndUser/delete',
        method: 'post',
        data: data
      })
    },
    clearUser (data) {
      return request({
        url: '/auth/system/relational/roleAndUser/clearUser',
        method: 'post',
        data: data
      })
    },
    findCheckedMenuByRoleId (param = {}) {
      return request({
        url: '/auth/system/relational/roleAndMenu/findCheckedMenuByRoleId?roleId=' + param.id,
        method: 'get'
      })
    },
    addMenu (data = {}) {
      return request({
        url: '/auth/system/relational/roleAndMenu/addMenu',
        method: 'post',
        data: data
      })
    }
  }
})
